Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the issue 1005 #1488

Merged
merged 4 commits into from
Jun 24, 2020
Merged

Fix for the issue 1005 #1488

merged 4 commits into from
Jun 24, 2020

Conversation

abhijeet-pathak
Copy link
Contributor

@abhijeet-pathak abhijeet-pathak commented Jun 20, 2020

(mermaid-js/mermaid-live-editor#1174)
A new attribute 'order' has been introduced in the task which records
the serial number of task in the script.
In ganttRenderer.js, the tasks are sorted by stratTime attribute.
The function which calculates 'y' for task rectangles, labels etc.
has been modified to correctly position it.

📑 Summary

Generate the SVG elements in the ascending order of datetime of the tasks.

Resolves mermaid-js/mermaid-live-editor#1174

📏 Design Decisions

An 'order' attribute has been added in the ganttDb to maintain the order in which tasks are added.
While creating the SVG rects and other assets, datetime order is considered and tasks are sorted accordingly.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

(https://github.com/mermaid-js/mermaid/issues/1005)
A new attribute 'order' has been introduced in the task which records
the serial number of task in the script.
In ganttRenderer.js, the tasks are sorted by stratTime attribute.
The function which calculates 'y' for task rectangles, lables etc.
has been modified to correctly position it.
@abhijeet-pathak
Copy link
Contributor Author

@GDFaber
Could you please assign somebody to review this?

@GDFaber GDFaber requested review from GDFaber and knsv June 23, 2020 11:02
@GDFaber
Copy link
Member

GDFaber commented Jun 23, 2020

Hi @abhijeet-pathak, thank you for looking into this. Can you provide a unit test in the specs as well? It will be harder to break the order accidentally if there is a test running frequently.

@abhijeet-pathak
Copy link
Contributor Author

Hi @abhijeet-pathak, thank you for looking into this. Can you provide a unit test in the specs as well? It will be harder to break the order accidentally if there is a test running frequently.

Sure @GDFaber .

@abhijeet-pathak
Copy link
Contributor Author

@GDFaber
I have added the test case to check the order maintained for the tasks.

@knsv knsv merged commit 0849aa3 into mermaid-js:develop Jun 24, 2020
@abhijeet-pathak abhijeet-pathak deleted the 1005_gantt_sequnce_creation_order_change branch June 24, 2020 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gantt Chart : The narrator navigation of the svg is not in right sequence
3 participants